<!--#include file="conn.asp"-->
<!--#include file="chkuser.asp"-->
<%
call adminRight(2)
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>添加信息</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="./../kindeditor/kindeditor.js"></script>
</head>
<body>
   <form method="post" name="myform" action="Admin_News_Save.asp?action=add" onSubmit="return checkadd()" target="_self">
    <div id="frame_Toolbar" class="toolbarBg"> 
		<a href="javascript:self.history.back();" class="icoBtn_ct"><span class="btnIco btnBack"></span>返回</a> 
		<a href="javascript:self.location.reload();" class="icoBtn_ct"><span class="btnIco btnReload"></span>刷新</a> 
		<span class="split ftSplit" ></span>
	<div id="guide" class="light_orange">请填写动态信息！</div>
	<div class="pageInfo right light_gray"></div>
    </div>
    <table class="cTable_2 table">
	<tr class="cTitle toolbarBg">
		<td colspan="2"><div class="cLeftPadding">添加信息</div></td>
	</tr>
<%if NewsClassSD_con>0 then%>	
	<tr>
	  <td width="15%" class="tRight">文章类别：</td>
	  <td>
		<%
		arrClassID=array(clng(request("OneClassID")),clng(request("TwoClassID")),clng(request("ThreeClassID")))
		strClassName=""
		for arrClassID_i=0 to ubound(arrClassID)
		if arrClassID(arrClassID_i)=0 then exit for
			set rsc=server.CreateObject("adodb.recordset")
			sqlc="select * from newsclass where id="&arrClassID(arrClassID_i)
			rsc.open sqlc,conn,1,1
			if rsc.eof then exit for
				if strClassName="" then
					strClassName=rsc("classname")
				else
					strClassName=strClassName&" <font color=ff0000>&gt;&gt;</font> "&rsc("classname")
				end if
			rsc.close
			set rsc=nothing
		next
		if strClassName="" then strClassName="请选择类别"
		%> 
		<div id="strClassName" class="left"><%=strClassName%></div> 
		<div class="left">
			<input name="OneClassID" id="OneClassID" type="hidden" value="<%=request("OneClassID")%>" />
			<input name="TwoClassID" id="TwoClassID" type="hidden" value="<%=request("TwoClassID")%>" />
			<input name="ThreeClassID" id="ThreeClassID" type="hidden" value="<%=request("ThreeClassID")%>" />
			<span style="color:Red;">*</span>
			<!--#include file="Admin_NewsClass_Select.asp"-->
			<font color="#FF6600">点击图标选择类别</font>
		</div>
      </td>
	</tr>
<%end if%>	  
	<tr>
		<td width="15%" class="tRight">文章标题：</td>
		<td><input name="Title" type="text" maxlength="255" style="width:300px;" />
	    <span id="RequiredFieldValidator1" style="color:Red;">*</span></td>
	</tr>
	<tr <%if NewsSubtitle_con=False then response.Write("style='display:none'") end if%>>
		<td class="tRight">文章副标题：</td>
		<td><input name="subTitle" type="text" maxlength="255" style="width:300px;" />
	    </td>
	</tr>
	<tr>
	  <td class="tRight">发布者：</td>
	  <td><span style="color:Red;">
	    <input name="publisher" type="text" maxlength="255" style="width:300px;" value="<%=session("SYSUser")%>" />
	  *</span></td>
	  </tr>
	<tr <%if Newspic_con=False then response.Write("style='display:none'") end if%>>
		<td class="tRight">图片上传：</td>
		<td>
		  <div class="left"><input name="pic" type="text" id="pic" style="width:300px;" maxlength="255" /></div>
	      <div class="left"><iframe src="Upload_form_lt.asp?n=pic&x=1" height="25" width="350" frameborder="0"></iframe></div>
		</td>
	</tr>
	<tr>
	  <td valign="top" class="tRight"></td>
	  <td><div style="width:650px; text-align:right; padding-top:8px"><span style="float:right"><iframe src="Upload_form_lt.asp?n=Content&x=2" height="25" width="320" frameborder="0"></iframe></span><span style="float:right; padding-top:4px">图片或文件快速上传：</span></div></td>
    </tr>
	<tr>
		<td valign="top" class="tRight">文章内容：</td>
		<td>
	    <script type="text/javascript">
		KE.show({
			id : 'Content',
			allowFileManager : true,
			afterCreate : function(id) {
				KE.blur(id);
			}
		});
	    </script>
		<div class="editor">
        <textarea id="Content" name="Content" style="width:650px;height:350px;visibility:hidden;"></textarea>
        </div>
		</td>
	</tr>
	<tr>
	  <td class="tRight">首页图片：</td>
	  <td><input name="DefaultPicUrl" type="text" id="DefaultPicUrl" value="images/nopic.gif" style="width:300px" maxlength="255" readonly="readonly"> 
                    <br>
                    首页的图片,直接从上传图片中选择： 
                    <select name="DefaultPicList" id="select" onChange="DefaultPicUrl.value=this.value;">
                      <option selected value="images/nopic.gif">不指定首页图片</option>
                    </select> <input name="UploadFiles" type="hidden" id="UploadFiles" >
                    </td>
	  </tr>
	<tr>
	  <td class="tRight">发布日期：</td>
	  <td><input name="AddDate" type="text" value="<%=now()%>" id="AddDate">
	    若自行修改，请保持原有格式！</td>
	  </tr>
	<tr>
	  <td class="tRight">推荐：</td>
	  <td><input name="Show" type="checkbox" id="Show" value="True" />
	  	  </td>
	  </tr>
    </table>
    <div id="cEndToolbar" class="toolbarBg">
      <div class="caButCase">
		    <input type="submit" name="Submit" value="确认添加" class="button">
	        <input type="reset" name="Submit2" value="清空重填" class="button">
      </div>
    </div>
  </form>
</body>
</html>
<script language="javascript">

function AddItem(strFileName){
  document.myform.DefaultPicUrl.value=strFileName;
  document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);
  document.myform.DefaultPicList.selectedIndex+=1;
  if(document.myform.UploadFiles.value==''){
	document.myform.UploadFiles.value=strFileName;
  }
  else{
    document.myform.UploadFiles.value=document.myform.UploadFiles.value+"|"+strFileName;
  }
}


function checkadd()
{
<%if NewsClassSD_con>0 then%>	
    if(document.myform.OneClassID.value=="")
		 {  
			alert("请选择信息类别!");  
			return (false);  
		  }
<%end if%>		  
    if(document.myform.Title.value=="")
		 {  
			alert("请填写标题!");  
			document.myform.Title.focus();  
			return (false);  
		  }
   if(document.myform.publisher.value=="")
		 {  
			alert("请填写发布者!");  
			document.myform.publisher.focus();  
			return (false);  
		  } 
	
}
</script>